import request from "@/utils/request";
let url = "/admin/api/rest/pages";
export const getPageById = params => {
    return request({
        url: "/admin/api/page/getPageById",
        params,
    });
};
export const getAllPage = params => {
    return request({
        url,
        params,
    });
};
export const addPage = data => {
    return request({
        url,
        method: "POST",
        data,
    });
};
export const updatePage = data => {
    return request({
        url,
        method: "PATCH",
        data,
    });
};
export const deletePage = data => {
    return request({
        url,
        method: "DELETE",
        data,
    });
};
let swiperUrl = "/admin/api/rest/swipers";
export const getAllSwiper = params => {
    return request({
        url: swiperUrl,
        params,
    });
};
export const addSwiper = data => {
    return request({
        url: swiperUrl,
        method: "POST",
        data,
    });
};
export const updateSwiper = data => {
    return request({
        url: swiperUrl,
        method: "PATCH",
        data,
    });
};
export const deleteSwiper = data => {
    return request({
        url: swiperUrl,
        method: "DELETE",
        data,
    });
};
let iconUrl = "/admin/api/rest/icons";
export const getAllIcon = params => {
    return request({
        url: iconUrl,
        params,
    });
};
export const addIcon = data => {
    return request({
        url: iconUrl,
        method: "POST",
        data,
    });
};
export const updateIcon = data => {
    return request({
        url: iconUrl,
        method: "PATCH",
        data,
    });
};
export const deleteIcon = data => {
    return request({
        url: iconUrl,
        method: "DELETE",
        data,
    });
};
let homeConfigUrl = "/admin/api/rest/homeconfigs";
export const getAllHomeConfig = params => {
    return request({
        url: homeConfigUrl,
        params,
    });
};
export const addHomeConfig = data => {
    return request({
        url: homeConfigUrl,
        method: "POST",
        data,
    });
};
export const updateHomeConfig = data => {
    return request({
        url: homeConfigUrl,
        method: "PATCH",
        data,
    });
};
export const deleteHomeConfig = data => {
    return request({
        url: homeConfigUrl,
        method: "DELETE",
        data,
    });
};
let hotSearchesUrl = "/admin/api/rest/hotsearches";
export const getAllHotSearch = params => {
    return request({
        url: hotSearchesUrl,
        params,
    });
};
export const addHotSearch = data => {
    return request({
        url: hotSearchesUrl,
        method: "POST",
        data,
    });
};
export const updateHotSearch = data => {
    return request({
        url: hotSearchesUrl,
        method: "PATCH",
        data,
    });
};
export const deleteHotSearch = data => {
    return request({
        url: hotSearchesUrl,
        method: "DELETE",
        data,
    });
};